﻿@model IEnumerable<ITSTOREBLL.SanPham>

@{
    ViewBag.Title = "Index";
    Layout = "~/Views/Shared/_Layout_admin.cshtml";
}

<h2>Index</h2>

<p>
    @Html.ActionLink("Create New", "Create")
</p>
<table>
    <tr>
        <th>
            sp_ID
        </th>
        <th>
            sp_Ten
        </th>
        <th>
            sp_Gia
        </th>
        <th>
            LoaiSanPham
        </th>
        <th>
            sp_SoLuong
        </th>
        <th>
            sp_ThongTin
        </th>
        <th>
            sp_Hinh
        </th>
        <th>
            NhaSanXuat
        </th>
        <th>
            sp_LuotXem
        </th>
        <th>
            sp_KhuyenMai
        </th>
        <th></th>
    </tr>

@foreach (var item in Model) {
    <tr>
        <td>
            @Html.DisplayFor(modelItem => item.sp_ID)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.sp_Ten)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.sp_Gia)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.LoaiSanPham.lsp_Ten)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.sp_SoLuong)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.sp_ThongTin)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.sp_Hinh)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.NhaSanXuat.nsx_Ten)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.sp_LuotXem)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.sp_KhuyenMai)
        </td>
        <td>
            @Html.ActionLink("Edit", "Edit", new { id=item.sp_ID }) |
            @Html.ActionLink("Details", "Details", new { id=item.sp_ID }) |
            @Html.ActionLink("Delete", "Delete", new { id=item.sp_ID })
        </td>
    </tr>
}

</table>
